<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta content="telephone=no" name="format-detection" />
    <!-- 留作将来统一添加 -->
    <TEMPLATE>${TEMPLATE}</TEMPLATE>
    <title>模板html</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <link rel="stylesheet" type="text/css" href="../../css/data-flex.min.css">
    <style type="text/css">
        .item {
            height: 40px;
            padding: 0 15px;
            border-bottom: 1px solid #e4e4e4;
        }
    </style>
</head>
<body>
    <div class="vueApp" v-cloak>
        <div class="item" v-for="item,index in listData" data-flex="main:justify cross:center">
            <p>卡拉OK名称</p>
            <div data-flex="">
                <p>来自：demo</p>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <p>播放</p>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/service/service-tool.js"></script>
<script type="text/javascript" src="../../script/service/service-app.js"></script>
<script type="text/javascript" src="../../script/service/service-user.js"></script>
<script type="text/javascript" src="../../script/service/service-logic.js"></script>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript">
    // html 的引号一律为双引号(""),js 为单引号('')
    var USER, $S, vm;
    apiready = function(){
        $S = SERVICE();
        USER = USER();
        console.log(JSON.stringify(api.pageParam) + '=====pageParam');
        
        fnInit();
    };
    
    // 初始化
    function fnInit() {
        vm = new Vue({
            el: '.vueApp',
            data: {
                info: null,
                listData: [{},{},{},{},{},{},{}],
                pageNo: 1,
                pageSize: 10
            }
        });
        // load();
    }

    function load() {
        getPageData('load');
        fnAddHeaderRefreshingEvent(function() { //设置下拉刷新
            getPageData('headerRefreshing');
        });

        fnAddFooterLoadingEvent(function() { // 设置上拉加载
            getPageData('load');
        });

    }

    // 获取页面数据
    function getPageData(sign) {
        if(sign == 'headerRefreshing') {
            vm.pageNo = 1;
        }else {
            vm.pageNo ++;
        }
        var url = '';
        var params = {};
        var callback = function(data) {
            if(vm.pageNo == '1') {
                vm.listData = [];
            }
            var listData = data.listData;
            for(var i = 0; i < listData.length; i ++) {
                var item = listData[i];

            }
            vm.listData = vm.listData.concat(data.listData);
            // status 为200时,只返回data
        };
        var error = function(res) {
            // status 不是200时,全部返回
            api.refreshHeaderLoadDone();
        };
        POST(url, params, callback, error);
    }

    // 点击item
    function handleItem(item) {

    }
</script>
</html>